import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Creat by TanLei
 * Description:
 * User:86183
 * Date:2022-06-16
 * Time:13:51
 */
public class Test10 {
    public static void main(String[] args) {
        try(InputStream inputStream = new FileInputStream("./test.txt")){
            byte[] buffer = new byte[1024];
            while (true){
                int len = inputStream.read(buffer);
                if(len == -1){
                    break;
                }
//                for(byte b: buffer){
//                    System.out.println(b);
//                }
                String s = new String(buffer,0,len,"UTF-8");
                System.out.println(s);
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
